/**
 * 
 */
package sv.gob.mh.dgii.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author melvin.henriquez
 * 
 */
@Entity
@Table(name = "GO_CONTROL_OMISO")
public class GoControlOmiso implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7794022712044649282L;
	private Long ncorrelativo;
	private GoCaso goCaso;
	private String cobligacion;
	private Date fpObligacion;
	private Date fhCompromiso;
	private String nit;
	private Long iindice;
	private String cusuario;

	public GoControlOmiso() {
	}

	public GoControlOmiso(Long ncorrelativo, String cobligacion,
			Date fpObligacion, Date fhCompromiso, String nit) {
		this.ncorrelativo = ncorrelativo;
		this.cobligacion = cobligacion;
		this.fpObligacion = fpObligacion;
		this.fhCompromiso = fhCompromiso;
		this.nit = nit;
	}

	public GoControlOmiso(Long ncorrelativo, GoCaso goCaso, String cobligacion,
			Date fpObligacion, Date fhCompromiso, String nit, Long iindice, String cusuario) {
		this.ncorrelativo = ncorrelativo;
		this.goCaso = goCaso;
		this.cobligacion = cobligacion;
		this.fpObligacion = fpObligacion;
		this.fhCompromiso = fhCompromiso;
		this.nit = nit;
		this.iindice = iindice;
		this.cusuario = cusuario;
	}

	/**
	 * @return the ncorrelativo
	 */
	@Id
	@Column(name = "N_CORRELATIVO", unique = true, nullable = false, precision = 10, scale = 0)
	public Long getNcorrelativo() {
		return ncorrelativo;
	}

	/**
	 * @param ncorrelativo
	 *            the ncorrelativo to set
	 */
	public void setNcorrelativo(Long ncorrelativo) {
		this.ncorrelativo = ncorrelativo;
	}

	/**
	 * @return the goCaso
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "N_CASO", referencedColumnName = "N_CASO"),
			@JoinColumn(name = "C_PLANES", referencedColumnName = "C_PLANES") })
	public GoCaso getGoCaso() {
		return goCaso;
	}

	/**
	 * @param goCaso
	 *            the goCaso to set
	 */
	public void setGoCaso(GoCaso goCaso) {
		this.goCaso = goCaso;
	}

	/**
	 * @return the cobligacion
	 */
	@Column(name = "C_OBLIGACION", nullable = false, length = 2)
	public String getCobligacion() {
		return cobligacion;
	}

	/**
	 * @param cobligacion
	 *            the cobligacion to set
	 */
	public void setCobligacion(String cobligacion) {
		this.cobligacion = cobligacion;
	}

	/**
	 * @return the fpObligacion
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FP_OBLIGACION", nullable = false, length = 7)
	public Date getFpObligacion() {
		return fpObligacion;
	}

	/**
	 * @param fpObligacion
	 *            the fpObligacion to set
	 */
	public void setFpObligacion(Date fpObligacion) {
		this.fpObligacion = fpObligacion;
	}

	/**
	 * @return the nit
	 */
	@Column(name = "NIT", nullable = false, length = 14)
	public String getNit() {
		return nit;
	}

	/**
	 * @param nit
	 *            the nit to set
	 */
	public void setNit(String nit) {
		this.nit = nit;
	}

	/**
	 * @return the iindice
	 */
	@Column(name = "I_INDICE", precision = 10, scale = 0)
	public Long getIindice() {
		return iindice;
	}

	/**
	 * @param iindice
	 *            the iindice to set
	 */
	public void setIindice(Long iindice) {
		this.iindice = iindice;
	}

	/**
	 * @return the cusuario
	 */
	@Column(name = "C_USUARIO", length = 8)
	public String getCusuario() {
		return cusuario;
	}

	/**
	 * @param cusuario
	 *            the cusuario to set
	 */
	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}
	
	/**
	 * @return the fhCompromiso
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "F_COMPROMISO", length = 7)
	public Date getFhCompromiso() {
		return fhCompromiso;
	}

	/**
	 * @param fhCompromiso
	 *            the fhCompromiso to set
	 */
	public void setFhCompromiso(Date fhCompromiso) {
		this.fhCompromiso = fhCompromiso;
	}
}
